# encoding:utf-8
from flask.ext.wtf import Form
from wtforms import TextField, DateField, HiddenField
from wtforms.validators import Optional
from utils import random_int, generate_trade_time, generate_code


class LoginForm(Form):
    pass


class UserInfo(Form):
    name = TextField('顾客名称', default='')
    qrcode = TextField('条码', default=generate_code())
    phone = TextField('联系电话', default='')
    address = TextField('地址', default='')
    score = TextField('积分', default=0)


class ProductTimeSaleSearchForm(Form):
    date_start = DateField("开始日期", validators=[Optional()])
    date_end = DateField("结束日期", validators=[Optional()])


class PhoneSettingInfo(Form):
    YNAbnormal = HiddenField("异常推送", default=0)
    YNVerification = HiddenField("主页验证", default=0)
    YNLogon = HiddenField("默认登录", default=0)
    YNBusiness = HiddenField("营业推送", default=0)


